﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %>
<%@ page import="com.util.SuperPage" %>
<%@ page import="com.mtbu.bean.SysLog" %>
<%@ page import="my.myorm.tool.jdbc.SQLExecutor" %>
<%@ page import="my.myorm.tool.jdbc.ResultList" %>
<%@ page import="my.myorm.tool.jdbc.Pages" %>
<%@ page import="my.myorm.tool.jdbc.SQLManager" %>
<%@ page import="com.util.SuperString" %>
<%@ page import="com.mtbu.comm.Util" %>
<%@ page import="com.util.SuperDate" %>
<%@ page import="java.util.Calendar" %>
<%@page import="com.mtbu.bean.BppChannel"%>
<%@page import="com.mtbu.service.DataUtil"%>
<%@page import="com.mtbu.bean.BppCata"%>
<%@page import="com.util.SuperFile"%>
<%@page import="com.util.SuperMath"%>
<%@page import="java.util.Date"%>
<%@page import="com.util.DESUtil"%>
<%@page import="com.mtbu.comm.Constant"%>
<%@page import="com.mtbu.comm.PageCache"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.HashMap"%>
<%@page import="com.mtbu.comm.AlgUtil"%>


<%@include file="channel_list_comm.jsp"%>
<%
    String curFile = SuperPage.getCurURLFile(request);
    String curName = "频道列表";
    int s_status=SuperString.getInt(request.getParameter("s_status"),-1);
    int s_ismobile=SuperString.getInt(request.getParameter("s_ismobile"),0);
    int s_id=SuperString.getInt(request.getParameter("s_id"),-1);
    String s_cataid=SuperString.notNullTrim(request.getParameter("s_cataid"));
    String s_cataname=SuperString.notNullTrim(request.getParameter("s_cataname"));
    int s_vt=SuperString.getInt(request.getParameter("s_vt"),-1);
    int s_videotype=SuperString.getInt(request.getParameter("s_videotype"),-1);
    int s_videolanguage=SuperString.getInt(request.getParameter("s_videolanguage"),-1);
    String s_sc_type=SuperString.notNullTrim(request.getParameter("s_sc_type"));
    String s_sc_value=SuperString.notNullTrim(request.getParameter("s_sc_value"));
    String startdate=SuperString.notNullTrim(request.getParameter("startdate"));
    String enddate=SuperString.notNullTrim(request.getParameter("enddate"));
    int s_pagesize=SuperString.getInt(request.getParameter("s_pagesize"));
    //用于记录显示的分集
    int setpid = SuperString.getInt(request.getParameter("setpid"),0);
    int setlength = SuperString.getInt(request.getParameter("setlength"),0);

    String dropparam="s_id,s_status,s_ismobile,s_cataid,s_cataname,s_vt,s_videotype,s_videolanguage,s_sc_type,s_sc_value,startdate,enddate,s_pagesize,issearch";
    if(request.getMethod().equalsIgnoreCase("post")){
        StringBuffer sbparam=new StringBuffer();
        sbparam.append("&issearch=1");
        if(s_status>-1) sbparam.append("&s_status=").append(s_status);
        if(s_id>-1) sbparam.append("&s_id=").append(s_id);
        if(s_vt>-1) sbparam.append("&s_vt=").append(s_vt);
        if(s_ismobile>0) sbparam.append("&s_ismobile=").append(s_ismobile);
        if(!"".equals(s_cataid)) sbparam.append("&s_cataid=").append(s_cataid);
        if(!"".equals(s_cataname)) sbparam.append("&s_cataname=").append(Util.encodeUrl(s_cataname));
        if(s_videotype>-1) sbparam.append("&s_videotype=").append(s_videotype);
        if(s_videolanguage>-1) sbparam.append("&s_videolanguage=").append(s_videolanguage);
        if(!"".equals(s_sc_type)) sbparam.append("&s_sc_type=").append(s_sc_type);
        if(!"".equals(s_sc_value)) sbparam.append("&s_sc_value=").append(Util.encodeUrl(s_sc_value));
        if(!"".equals(startdate)) sbparam.append("&startdate=").append(startdate);
        if(!"".equals(enddate)) sbparam.append("&enddate=").append(enddate);
        if(s_pagesize>0) sbparam.append("&s_pagesize=").append(s_pagesize);
        if(setpid>0) sbparam.append("&setpid=").append(setpid);
        if(setlength>0) sbparam.append("&setlength=").append(setlength);
        String strparam=sbparam.toString();
        if(strparam.startsWith("&")) strparam="?"+strparam.substring(1);
        strparam+="".equals(strparam)? SuperPage.getQueryQ(request,dropparam): SuperPage.getQueryAnd(request,dropparam);
        response.sendRedirect(curFile+strparam);
        return;
    }
    s_sc_value=SuperString.replace(s_sc_value,"'","\\'");
    //组合条件
    StringBuffer strw = new StringBuffer();

    if(!"".equals(s_sc_value)) strw.append("and ").append(s_sc_type).append(" like '%").append(s_sc_value).append("%'");
    if(s_status>-1) strw.append(" and b.status=").append(s_status);
    if(s_id>-1) strw.append(" and b.id=").append(s_id);
    if(!"".equals(s_cataid)) strw.append(" and b.cataid in (").append(AlgUtil.getAllBppCataIDS(s_cataid)).append(")");
    if(s_vt>-1) strw.append(" and b.vt=").append(s_vt);
    if(s_videotype>-1) strw.append(" and b.videotype=").append(s_videotype);
    if(s_videolanguage>-1) strw.append(" and b.videolanguage=").append(s_videolanguage);
    if(!startdate.equals("")) strw.append(" and b.createtime>='").append(startdate).append("'");
    if(!enddate.equals("")) strw.append(" and b.createtime<'").append(new SuperDate(enddate,true).getAddedDate(Calendar.DAY_OF_MONTH,1).getDateString()).append("'");

    String strwhere = Util.getWhereSQL(strw);

    String order = SuperString.notNullTrim(request.getParameter("order"));
    String orderby = order.length() == 0 ? " order by b.createtime desc" :
            " order by " + order;

    SQLExecutor dbconn = SQLManager.getSQLExecutor("EPGDS");
    String sql="";
    if(s_ismobile==1){
    	sql = "select distinct b.ID,b.Title,b.EpTitle,b.VT,b.RID,b.CataID,b.PID,b.GID,b.Duration,b.Bitrate,b.Status,b.Rank,b.PicUrl,b.VideoLanguage,"+
    		"b.VideoType,b.filename,b.infoid from bpp_channel b join mobile_channel m on (b.id=m.channelid and m.status=1)"+ strwhere + orderby;
    }else{
    	sql = "select b.ID,b.Title,b.EpTitle,b.VT,b.RID,b.CataID,b.PID,b.GID,b.Duration,b.Bitrate,b.Status,b.Rank,b.PicUrl,b.VideoLanguage,b.VideoType,"+
    		"b.filename,b.infoid from bpp_channel b"+ strwhere + orderby;
    }
    int pagesize=Util.getPageSizeOfCookie(request,response,s_pagesize);
    Pages pages = new Pages(pagesize, "b.id", request);
    ResultList rs = null;
    if(s_id<=0 && s_sc_value.equals("") && startdate.equals("") && enddate.equals("")){
    	int count = PageCache.getPageCountBySql(sql,"b.id","EPGDS");
    	rs = dbconn.query(sql,true,pages,count,"");
    }else{
    	rs = dbconn.query(sql,true,pages,"");
    }
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><%=curName%></title>
<link href="css/adminPPLive.css" rel="stylesheet" type="text/css" />
<link href="css/popcore.css" type="text/css" rel="stylesheet"/>
<script language="javascript" src="js/comm.js"></script>
<script language="javascript" src="js/events.js"></script>
<script language="javascript" src="js/eventutil.js"></script>
<script language="javascript" src="js/tablecell.js"></script>
<script type="text/javascript" src="js/popup_layer.js" language="javascript"></script>
<script type="text/javascript" src="js/jquery.js" language="javascript"></script>
<script type="text/javascript" src="js/jquery.alerts.js" language="javascript"></script>
<script type="text/javascript" src="js/tooltips.js" language="javascript"></script>
<script type="text/javascript" src="js/commselect_catalog.js" language="javascript"></script>
<script language="javascript" src="js/calendar.js"></script>
</head>
<body>
<div id="toolTipLayer" style="position:absolute; visibility: hidden"></div>
<script language="JavaScript">initToolTips();</script>
<div class="adminRight">
  <div class="adminBorderTop">
    <div class="adminBorderTopLeft"></div>
    <div class="adminBorderTopTitle">
      <div class="adminBorderTopTitleLeft"></div>
      <div class="adminBorderTopTitleMiddle">频道列表</div>
      <div class="adminBorderTopTitleRight"></div>
    </div>
    <div class="adminBorderTopRight"></div>
  </div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F7F8F9">
  <tr>
    <td class="adminBorderMiddleLeft"></td>
    <td>
    <div class="admTab">
      <ul>
      <%for(int i=0;i<tab_urls.length;i++){%>
      	<%if(tab_func[i]){%>
			<li>
			<a href="<%=tab_urls[i]%><%=SuperPage.getQueryString(request,"mid",false)%>"
				<% if(request.getRequestURI().endsWith(tab_urls[i]) )out.println("class='admTabCut'");%>
			> <%=tab_names[i]%>
			</a>
			</li>
		<%}%>
      <%} %>
      </ul>
    </div>
    <div class="adminWel" id="admBppChannel">
      <div class="adminPrompt">
        <div class="adminPromptTilte"><span>输入查询条件</span></div>
        <div class="adminPromptContent">
        <form name="form_s" action="<%=curFile%><%=SuperPage.getQueryQ(request,dropparam)%>" method="post" class="formline">
    	<table width="100%"  border="0" cellspacing="1" cellpadding="2" style="margin:5px 0;">
        <tr>
          <td width="91%">
            频道ID
            <input name="s_id" type="text" id="s_id" title="ID" value="<%=s_id>-1?s_id:""%>" size="8" maxlength="30" class="admTextComm">
            分类
            <input name="s_cataid" type="hidden" id="comm_ids_bppcata" value="<%=s_cataid%>">
            <input name="s_cataname" type="text" id="s_cataname" title="分类" value="<%=s_cataname%>" size="16" maxlength="30" readonly="readonly" onfocus="selectCataToInput(EventUtil.getEvent().target,'bppcata')" class="admTextComm" style="margin-right: -19px;">
            <a id="clear_s_cataname" href="javascript:void(0)" onClick="$('#s_cataname').val('');$('#comm_ids_bppcata').val('');"><img src="images/comm/icondel.gif" width="12" height="12" border="0" title="清除"></a>
            <select name="s_sc_type" id="s_sc_type" title="搜索类型" class="admTextComm">
            	<option value="b.title" <%=s_sc_type.equals("title")?"selected=selected":""%>>频道名</option>
            	<option value="b.eptitle" <%=s_sc_type.equals("eptitle")?"selected=selected":""%>>分集名称</option>
            	<option value="b.filename" <%=s_sc_type.equals("filename")?"selected=selected":""%>>文件名</option>
            </select>
            <input name="s_sc_value" type="text" id="s_sc_value" value="<%=s_sc_value%>" maxlength="30" class="admTextComm">

        入库时间
            <input type="text" name="startdate" id="startdate" onclick="calendar(EventUtil.getEvent().target)" value="<%=startdate%>" title="开始时间" size="14" readonly="readonly" class="admTextComm" style="margin-right: -19px;">
	        <a id="clear_begintime" href="javascript:void(0)" onClick="$('#startdate').val('');"><img src="images/comm/icondel.gif" width="12" height="12" border="0" title="清除开始时间"></a>
		    到
		    <input type="text" name="enddate" id="enddate" onclick="calendar(EventUtil.getEvent().target)" value="<%=enddate%>" title="结束时间" size="14" readonly="readonly" class="admTextComm" style="margin-right: -19px;">
	        <a id="clear_begintime" href="javascript:void(0)" onClick="$('#enddate').val('');"><img src="images/comm/icondel.gif" width="12" height="12" border="0" title="清除结束时间"></a>

            每页显示
            <input name="s_pagesize" type="text" id="s_pagesize" title="每页显示" value="<%=pagesize%>" size="2" maxlength="6" class="admTextComm">
            <input name="Submit2" type="submit" value="" style="background-image:url(images/adminSearchBtn.png);width: 59;height: 22;border:0px;cursor:pointer;">
            <br/><br/>
         状态
            <select name="s_status" id="s_status" title="视频语言" onchange="$('form').submit();" class="admTextComm">
            	<option value="">--全部--</option>
            	<%for(int i=0;i<DataUtil.getListStatus().size();i++){ %>
            	<option value="<%=DataUtil.getListStatus().get(i)%>" <%=DataUtil.getListStatus().get(i)==s_status?"selected=selected":""%>><%=DataUtil.getMapStatus().get(DataUtil.getListStatus().get(i))%></option>
            	<%} %>
            </select>
            频道类型
            <select name="s_vt" id="s_vt" title="频道类型" onchange="$('form').submit();" class="admTextComm">
            	<option value="">--全部--</option>
            	<%for(int i=0;i<DataUtil.getListVT().size();i++){ %>
            	<option value="<%=DataUtil.getListVT().get(i)%>" <%=DataUtil.getListVT().get(i)==s_vt?"selected=selected":""%>><%=DataUtil.getMapVT().get(DataUtil.getListVT().get(i))%></option>
            	<%} %>
            </select>
           视频类型
           <select name="s_videotype" id="s_videotype" title="视频类型 " onchange="$('form').submit();" class="admTextComm">
            	<option value="">--全部--</option>
            	<%for(int i=0;i<DataUtil.getListVideoType().size();i++){ %>
            	<option value="<%=DataUtil.getListVideoType().get(i)%>" <%=DataUtil.getListVideoType().get(i)==s_videotype?"selected=selected":""%>><%=DataUtil.getMapVideoType().get(DataUtil.getListVideoType().get(i))%></option>
            	<%} %>
            </select>
          视频语言
            <select name="s_videolanguage" id="s_videolanguage" title="视频语言" onchange="$('form').submit();" class="admTextComm">
            	<option value="">--全部--</option>
            	<%for(int i=0;i<DataUtil.getListVideoLanguage().size();i++){ %>
            	<option value="<%=DataUtil.getListVideoLanguage().get(i)%>" <%=DataUtil.getListVideoLanguage().get(i)==s_videolanguage?"selected=selected":""%>><%=DataUtil.getMapVideoLanguage().get(DataUtil.getListVideoLanguage().get(i))%></option>
            	<%} %>
            </select>
            <input type="checkbox" name="s_ismobile" value="1" <%=s_ismobile==1?"checked=checked":""%>>
            mobile节目
            </td>
        </tr>
          </table></form>
        </div>
      </div>
    </div>
<!--分页开始-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr valign="middle">
    <td width="100%" colspan="2" align="left" bgcolor="#e7f0f9"><div class="admPage"><%=SuperPage.generatePageNavSingleNew(rs.getAllCount(), request, null, pages.getPageSize(),"个")%></div></td>
  </tr>
  <tr>
    <td width="80%" bgcolor="#e7f0f9" align="left">

	<%for(int i=0;i<projects.size();i++){%>
		<div class="admHouseBtn">
			<li id="bc_add_up">
			<a href="javascript:void(0)" onclick="batchAdd2Wasu('up','<%=projects.get(i).getId()%>','<%=projects.get(i).getName()%>')">批量加入<%=projects.get(i).getName()%></a>
			</li>
		</div>
	<%}%>

    </td>
    <td width="20%" align="right" bgcolor="#e7f0f9">页内查找:<input type="text" id="filterPageIpt" onkeyup="filtePage()" class="admTextSix"/></td>
  </tr>
</table>
<!--分页结束-->
<table id="table_data" width="100%" border="0" cellpadding="1" cellspacing="1" class="table_bord">
  <tr class="table_bord_ttl">
    <td nowrap width="10"><input name="ckall" type="checkbox" class="checkbox"  onClick="javascript:allselect(this)"></td>
    <td nowrap width="40" onClick="title_click('<%=Util.getOrderUrl("b.id",order,request)%>')">ID<%=Util.getOrderByImgHTML("b.id",order)%></td>
    <td nowrap onClick="title_click('<%=Util.getOrderUrl("b.title",order,request)%>')">频道名<%=Util.getOrderByImgHTML("b.title",order)%></td>
    <td nowrap width="60" onClick="title_click('<%=Util.getOrderUrl("b.eptitle",order,request)%>')">分集名<%=Util.getOrderByImgHTML("b.eptitle",order)%></td>
    <td nowrap width="65" onClick="title_click('<%=Util.getOrderUrl("b.VT",order,request)%>')">频道类型<%=Util.getOrderByImgHTML("b.VT",order)%></td>
    <td nowrap width="65" onClick="title_click('<%=Util.getOrderUrl("b.CataID",order,request)%>')">基本分类<%=Util.getOrderByImgHTML("b.CataID",order)%></td>
    <td nowrap width="35" onClick="title_click('<%=Util.getOrderUrl("b.Duration",order,request)%>')">时长<%=Util.getOrderByImgHTML("b.Duration",order)%></td>
    <td nowrap width="50" onClick="title_click('<%=Util.getOrderUrl("b.Bitrate",order,request)%>')">码流率<%=Util.getOrderByImgHTML("b.Bitrate",order)%></td>
    <td nowrap width="50" onClick="title_click('<%=Util.getOrderUrl("b.Status",order,request)%>')">状态<%=Util.getOrderByImgHTML("b.Status",order)%></td>
    <td nowrap width="30" onClick="title_click('<%=Util.getOrderUrl("b.Rank",order,request)%>')">权重<%=Util.getOrderByImgHTML("b.Rank",order)%></td>
    <td nowrap width="30">截图</td>
    <td nowrap width="40" onClick="title_click('<%=Util.getOrderUrl("b.VideoLanguage",order,request)%>')">语言<%=Util.getOrderByImgHTML("b.VideoLanguage",order)%></td>
    <td nowrap width="60" onClick="title_click('<%=Util.getOrderUrl("b.VideoType",order,request)%>')">视频类型<%=Util.getOrderByImgHTML("b.VideoType",order)%></td>
    <td nowrap width="110">操作</td>
  </tr>
<%
    for(int i = 0; i < rs.size(); i++) {
    	BppChannel bc= rs.get(i).get(BppChannel.class);
		//System.out.println("bc:" + bc);

        String trclass = i % 2 == 0 ? "tr_class1" : "tr_class2";
        String picurl = "";
        if(SuperString.notNullTrim(bc.getPicUrl()).equals("") || SuperString.notNullTrim(bc.getRID()).length()<4) picurl="images/set_bg.gif";
        else picurl = Util.getProperties("BPP_PIC_SP_SERVER_URL")+bc.getRID().substring(0,2)+"/"+bc.getRID().substring(2,4)+"/"+bc.getRID()+"/"+bc.getPicUrl();
        String picasurl = "";
        if(SuperString.notNullTrim(bc.getPicUrl()).equals("") || SuperString.notNullTrim(bc.getRID()).length()<4) picasurl="images/set_bg.gif";
        else picasurl = Util.getProperties("BPP_PIC_AS_SERVER_URL")+bc.getRID().substring(0,2)+"/"+bc.getRID().substring(2,4)+"/"+bc.getRID()+"/"+bc.getPicUrl();
%>
  <tr name="datatr" id="tr_channel_<%=bc.getId()%>" class="<%=trclass%>" onMouseMove="cell_over(this);" onMouseOut="cell_out(this)" onClick="cell_click(this);" height="20">
    <td nowrap class="font22"><input id="ids_<%=bc.getId()%>" name="check_id" type="checkbox" value="<%=bc.getId() %>"  class="checkbox"></td>
    <td><%=bc.getId()%></td>
    <td><%=bc.getTitle()%></td>
    <td><%=bc.getEpTitle()%></td>
    <td><span style="float: left;"><%=DataUtil.getVT(bc.getVT())%></span></td>
    <td><%=DataUtil.getBppCataTitleWithParent(bc.getCataID(),false)%></td>
    <td><%=bc.getDuration()%></td>
    <td><%=bc.getBitrate()%></td>
    <td><font color="<%=bc.getStatus()<_statuscolors.length?_statuscolors[bc.getStatus()]:""%>"><%=DataUtil.getStatus(bc.getStatus())%></font></td>
    <td><%=bc.getRank()%></td>
    <td><a onmouseover="preview(this)" onmouseout="closePreview()"  href="<%=picasurl%>" target="_blank" id="<%=picurl%>" class="preview"><img src="images/adminPicIcon.jpg"/></a></td>
	<td><font style="font-size: 12px;"><%=DataUtil.getVideoLanguage(bc.getVideoLanguage())%></font></td>
    <td><font style="font-size: 12px;"><%=DataUtil.getVideoType(bc.getVideoType())%></font></td>
    <td>
    	<%for(int j=1;j<tab_urls.length;j++){%>
      	<%if(tab_func[j]){%><a href="javascript:void(0)" onclick="add2Wasu(<%=bc.getId()%>,'<%=tab_tbl[j]%>','加入<%=tab_names[j]%>')" class="abutton">加入<%=tab_names[j].replace("节目","")%></a><%}%>
      	<%if(j<tab_urls.length-1)out.println("<br/>");%>
      <%} %>
    </td>
  </tr>
<%
    }
    if(rs.size()==0){
%>
  <tr bgcolor="#FFFFFF">
    <td height="50" colspan="20" align="center">没有数据</td>
  </tr>
  <%
    }
%>
</table>
<!--分页开始-->
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="80%" bgcolor="#e7f0f9" align="left">
	<%for(int i=0;i<projects.size();i++){%>

		<div class="admHouseBtn">
			<li id="bc_add_down">
			<a href="javascript:void(0)" onclick="batchAdd2Wasu('down','<%=projects.get(i).getId()%>','<%=projects.get(i).getName()%>')">批量加入<%=projects.get(i).getName()%></a>
			</li>
		</div>

	<%}%>
    </td>
  </tr>
    <tr valign="middle">
    <td width="100%" align="left" bgcolor="#e7f0f9"><div class="admPage"><%=SuperPage.generatePageNavSingleNew(rs.getAllCount(), request, null, pages.getPageSize(),"个")%></div></td>
  </tr>
</table>
   </td>
    <td class="adminBorderMiddleRight"></td>
  </tr>
</table>
<div class="adminBorderBottom">
  <div class="adminBorderBottomLeft"></div>
  <div class="adminBorderBottomRight"></div>
</div>
</div>
<script type="text/javascript">
initCommSel(11,null,'|');
var selall=false;
function allselect(e){
    $("input[name='check_id']").attr("checked",$(e).attr("checked"));
    $("input[name='ckall']").attr("checked",$(e).attr("checked"));
}
function dbClickTR(id){
	if($('#ids_'+id).attr('checked')) $('#ids_'+id).attr('checked',false);
	else $('#ids_'+id).attr('checked',true);
}
function batchAdd2Wasu(split,pid,pt_name){
    var ids="";
    var checks=document.getElementsByName("check_id");
    if(checks==null||checks==undefined) return;
    for(var i=0;i<checks.length;i++){
        if(checks[i].checked){
           ids+=checks[i].value+",";
        }
    }
    if(ids==''){
        jError('<font color=\"red\">请选择要添加的频道!</font>', '批量加入'+pt_name, function(r){});
        return;
    }
    jAlarm('请确认您是否要将选中频道批量加入'+pt_name+'?', '批量加入'+pt_name, function(r) {
		if(r){
			$("#sp_act_"+split).html("正在处理...");
	        $.getJSON("XML_channel_mod.jsp", {ids:ids, act:"bcadd",pid:pid,time:new Date().getTime()}, function(data){
	        	$("#sp_act_"+split).html('<a href="javascript:void(0)">批量加入'+pt_name+'</a>');
	        	if(data['result']==0){
		        	 var result = '<font color=\"red\">发生错误!</font>频道批量加入'+pt_name+'操作<font color=\"red\">失败</font>!';
					 jError(result, '批量加入'+pt_name, function(r) {
	        			if(r){
	        				location.reload(true);
	        			}
        	    	});
	        	}else{
        			location.reload(true);
	        	}
	       	});
		}
	});
}
function add2Wasu(id,pt,pt_name){
    jAlarm('请确认您是否要将选该频道加入'+pt_name+'?', '频道加入'+pt_name, function(r) {
		if(r){
	        $.getJSON("XML_channel_mod.jsp", {ids:id, act:"bcadd",pt:pt,time:new Date().getTime()}, function(data){
	        	if(data['result']==0){
		        	 var result = '<font color=\"red\">发生错误!</font>频道加入'+pt_name+'操作<font color=\"red\">失败</font>!';
		        	 jError(result, '频道加入'+pt_name, function(r) {
	        			if(r){
	        				location.reload(true);
	        			}
        	    	});
	        	}else{
        			location.reload(true);
	        	}
	       	});
		}
	});
}
</script>
<%@include file="sys_commfooter.jsp"%>
</body>
</html>